{% if config['BODY_FORMAT'] == 'html' %}
<script src="{{ url_for('static', filename='admin/ckeditor/ckeditor.js') }}"></script>
{% else %}
{% if Setting.get('mdeditor') == 'cmeditor' %}
<link rel="stylesheet" href="/static/admin/cmeditor/lib/codemirror.css">
<link rel="stylesheet" href="/static/admin/cmeditor/addon/dialog/dialog.css">
<link rel="stylesheet" href="/static/admin/cmeditor/addon/display/fullscreen.css">

<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/lib/codemirror.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/mode/markdown/markdown.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/dialog/dialog.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/search/searchcursor.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/edit/matchbrackets.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/edit/continuelist.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/display/fullscreen.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/selection/active-line.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/addon/edit/trailingspace.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='admin/cmeditor/keymap/vim.js') }}"></script>

<style type="text/css">
.CodeMirror {border: 3px solid #ccc; }
.keybuffer {font-size: 13px; width: 300px; height: 30px;}
.cm-trailingspace {
  background-image: url();
  background-position: bottom left;
  background-repeat: repeat-x;}
</style>
<!--<div class="keybuffer">Key buffer: <span id="command-display"></span></div>-->
<script src="{{ url_for('static', filename='admin/cmeditor/markitup.js') }}"></script>
{% else %}
<link rel="stylesheet" type="text/css" href="/static/admin/markitup/skins/markdown/style.css">
<!--  markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="/static/admin/markitup/sets/markdown/style.css" />
<!-- markItUp! -->
<script type="text/javascript" src="/static/admin/markitup/jquery.markitup.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="/static/admin/markitup/sets/markdown/ajaxfileupload.js"></script>
<script type="text/javascript" src="/static/admin/markitup/sets/markdown/set.js"></script>

<script language="javascript">
$(document).ready(function()	{
    $('.markitup').markItUp(myMarkdownSettings);
    });
</script>
{% endif %}
{% endif %}
